// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_a.p_b;

import java.io.*;

import org.apache.http.util.EncodingUtils;

// Referenced classes of package com.nnee.a.b:
//            d, e, f

public class cls_b extends cls_d {

	public cls_b(String s1, cls_f f1) {
		this(s1, f1, null, null);
	}

	public cls_b(String s1, cls_f f1, String s2, String s3) {
		super(s1, s2, s3, "binary");

		if (s2 == null)
			s2 = "application/octet-stream";
		if (s3 == null)
			s3 = "ISO-8859-1";

		if (f1 == null) {
			throw new IllegalArgumentException("Source may not be null");
		} else {
			v = f1;
			return;
		}
	}

	public cls_b(String s1, File file) throws FileNotFoundException {
		this(s1, ((cls_f) (new cls_e(file))), null, null);
	}

	public cls_b(String s1, File file, String s2, String s3) throws FileNotFoundException {
		this(s1, ((cls_f) (new cls_e(file))), s2, s3);
	}

	public cls_b(String s1, String s2, File file) throws FileNotFoundException {
		this(s1, ((cls_f) (new cls_e(s2, file))), null, null);
	}

	public cls_b(String s1, String s2, File file, String s3, String s4) throws FileNotFoundException {
		this(s1, ((cls_f) (new cls_e(s2, file))), s3, s4);
	}

	protected void b(OutputStream outputstream) throws IOException {
		super.b(outputstream);
		String s1 = v.b();
		if (s1 != null) {
			outputstream.write(u);
			outputstream.write(f);
			outputstream.write(EncodingUtils.getAsciiBytes(s1));
			outputstream.write(f);
		}
	}

	protected void f(OutputStream outputstream) {
		if (h() != 0L) {
			byte abyte0[];
			InputStream inputstream;
			abyte0 = new byte[4096];
			inputstream = v.c();
			Exception exception;
			int i = 0;
			do {

				try {
					i = inputstream.read(abyte0);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				if (i < 0)
					break;
				try {
					outputstream.write(abyte0, 0, i);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			} while (true);
			try {
				inputstream.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	protected long h() {
		return v.a();
	}

	protected cls_f j() {
		return v;
	}

	public static final String q = "application/octet-stream";
	public static final String r = "ISO-8859-1";
	public static final String s = "binary";
	protected static final String t = "; filename=";
	private static final byte u[] = EncodingUtils.getAsciiBytes("; filename=");
	private cls_f v;

}
